<template>
	<view class="pageContent">
		<view class="setSwi" v-if="0">
			<view class="houseMain">
				<view class="houseFace">人脸开门<text class="houseFaceSta" v-if="formData.faceSwitch==2"
						@click="goDoorList">查看审核结果</text></view>
				<view class="houseMsg" v-if="formData.faceSwitch==0">打开上传人脸照片</view>
				<view class="houseMsg" v-if="formData.faceSwitch==1">上传人脸照校验中</view>
				<view class="houseMsg" v-if="formData.faceSwitch==2">请再上传人脸照片</view>
				<view class="houseMsg" v-if="formData.faceSwitch==3">正在使用人脸识别开门</view>
			</view>
			<!-- 人脸同步状态0:未录入1:待审核2:审核失败3:审核通过 -->
			<view class="houseRight">
				<!-- <view >{{formData.faceSwitch}}</view> -->
				<view v-if="formData.faceSwitch==1" @click="imagePhoto">待审核</view>
				<view class="houseRightFail" v-if="formData.faceSwitch==2">审核失败</view>
				<!-- <view v-if="formData.faceSwitch==3">审核通过</view> -->
				<image class="switchImg" v-if="formData.faceSwitch!=1 && formData.faceSwitch!=3"
					:src="images +'/switchOff.png'" mode="widthFix" @click="imagePhoto" />
				<image class="switchImg" v-if="formData.faceSwitch==3" :src="images +'/switchOn.png'" mode="widthFix"
					@click="faceOff" />
			</view>
		</view>
		<view class="setSwi" v-if="0">
			<view class="houseMain">
				<view class="houseFace">工单通知</view>
				<view class="houseMsg">关闭将接收不到工单通知</view>
			</view>
			<view class="houseRight">
				<image class="switchImg" v-if="formData.visitorNotifySwitch==0" :src="images +'/switchOff.png'"
					mode="widthFix" @click="notifySwi(1)" />
				<image class="switchImg" v-if="formData.visitorNotifySwitch==1" :src="images +'/switchOn.png'"
					mode="widthFix" @click="notifySwi(0)" />
			</view>
		</view>
<!-- 		<view class="setAbou" @click="AboutUs">
			<view class="houseFace">关于我们</view>
			<view class="rightArrow"></view>
		</view> -->

		<button class="btOne btBottom" @click="loginOut">退出登录</button>
	</view>
</template>

<script>
	import config from '../../static/config.js'
	import util from '../../static/utils/util.js'
	export default {
		data() {
			return {
				images: config.images,
				localImages: config.localImages,
				title: '123',
				token: '',
				info: '',
				formData: {
					visitorNotifySwitch: 0,
					faceSta: 0,
				},
				faceUrl: '',
			}
		},
		onLoad() {
			var token = wx.getStorageSync('token');
			var notice = wx.getStorageSync('notice');
			var info = wx.getStorageSync('info');
			if (token) {
				this.token = true;
				this.formData.visitorNotifySwitch=notice
			}
		},
		methods: {
			async faceSatus() {
				var url = '/UserServer/mini/install/faceSatus'
				var params = {
					equipmentId: this.equipment.equipmentId || '1',
					gatePostId: this.equipment.gatePostId || '123'
				}
				var options = {
					url,
					params
				}
				var param = await util.requestPro(options)
				return param
			},
			notifySwi(index) {
				wx.setStorageSync('notice', index)
				this.formData.visitorNotifySwitch = index
			},
			loginOut() {
				wx.clearStorageSync();
				wx.redirectTo({
					url: '/pages/index/login1'
				})
			},
			systemSet() {
				wx.navigateTo({
					url: '/pages/index/systemSet'
				})
			},
		},

	}
</script>

<style>
	.pageContent {
		padding: 50rpx 30rpx 0rpx 30rpx;
		background: #FFFFFF;
		height: 100vh;
	}

	.setSwi {
		display: flex;
		justify-content: space-between;
		padding: 0rpx 0rpx 60rpx 0rpx;
	}

	.houseMain {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.houseFace {
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		line-height: 42rpx;
		padding-bottom: 6rpx;
	}

	.houseFaceSta {
		background: #FF6E5D;
		border-radius: 32rpx;
		font-size: 22rpx;
		color: #FFFFFF;
		padding: 2rpx 10rpx 2rpx 10rpx;
		margin: 0rpx 0rpx 0rpx 10rpx;
	}

	.houseMsg {
		font-size: 26rpx;
		font-weight: 400;
		color: #999999;
		line-height: 30rpx;
	}

	.houseRight {
		display: flex;
		align-items: center;
	}

	.houseRightFail {
		font-size: 30rpx;
		color: #FF6E5D;
	}

	.switchImg {
		width: 72rpx;
		height: 32rpx;
		margin-left: 10rpx;
		/* border: 0.3rpx solid #f00; */

	}

	.setAbou {
		position: relative;
		padding: 20rpx 0rpx 20rpx 0rpx;
	}

	.rightArrow {
		height: 24rpx;
		width: 24rpx;
		top: 24rpx;
		right: 10rpx;
	}

	.btBottom {
		position: fixed;
		width: 600rpx;
		bottom: 220rpx;
		left: 50%;
		margin-left: -300rpx;
	}
</style>
